<?php
class Role extends Model
{
    protected $_partialOrder = 'sort ASC,role_id DESC';

    public static function instance(){
        static $obj;
        if(!$obj) $obj = new self();
        return $obj;
    }

	function getByTitle($title)
	{
        return $this->getList(array('title'=>$title), 0, 1);
	}
	function getTitle($role_id)
    {
        return $this->getCol($role_id, 'title');
	}

	function getRealList($where=array(), $s=0, $l=0)
	{
		if($where) {
			$where['type']	=	0;
		}
		else {
			$where	=	array('type'=>0);
		}
		return $this->getList($where, $s, $l);
	}

}
?>
